#include <sys/select.h>

#define SS_FIVE_MEGABYTES (5242880)
class Socket_Server_T
{
	public:
		Socket_Server_T(unsigned short port_number, unsigned short secure_port_number,
		                  char const * log_file = "SocketServer.log",
		                  size_t max_log_file_size = SS_FIVE_MEGABYTES);

	virtual ~Socket_Server_T();

	virtual void Run(void);



	int m_accept_fd;
	std::map<uint32_t, SS_Broadcast_Message_T> m_broadcast_map;
	std::map<uint32_t, SS_Client_T *> m_clients_by_uid;
	bool_t m_exit_requested;
	SS_JSON_Message_Log_T * m_json_logger;
	struct timespec m_last_soh_time;
	std::map<int, SS_Client_T *>  m_pending_clients;
	unsigned short m_port_number;
	bool_t m_reset_cache;
	int m_secure_accept_fd;
	unsigned short m_secure_port_number;
	bool_t m_soh_enabled;
	std::map< uint32_t, std::set<uint32_t> > m_spies_from;
	std::map< uint32_t, std::set<uint32_t> > m_spies_to;
	std::map<uint16_t, std::map<uint32_t, SS_Client_T *> > m_spy_domain_map;
	SS_Client_T* m_spy_from_client;
	uint32_t m_spy_from_uid;
	std::map<uint32_t, std::map<uint32_t, SS_Client_T *> > m_spy_message_code_map;
	SS_Client_T* m_spy_to_client;
	uint32_t m_spy_to_uid;
}
#endif






